from flask import Flask


def create_app():
    app = Flask(__name__)

    # 修改 Jinja 变量的定界符
    app.jinja_env.variable_start_string = '<<'
    app.jinja_env.variable_end_string = '>>'

    from app.routes.main import main_bp
    from app.routes.ai import ai_bp

    app.register_blueprint(main_bp)
    app.register_blueprint(ai_bp)

    return app
